﻿#region

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BuXiaChu.OrderDishes.Model;
using BuXiaChu.OrderDishes.DAL;

#endregion

namespace BuXiaChu.OrderDishes.BLL
{
    public class RestaurantManager
    {
        #region Restaurant
        /// <summary>
        /// Insert Or Update
        /// </summary>
        public static bool Save(RestaurantModel obj)
        {
            return RestaurantDAL.Save(obj);
        }

        public static RestaurantModel GetRestaurantById(int id)
        {
            return RestaurantDAL.GetRestaurantById(id);
        }

        public static List<RestaurantModel> Search(string sqlWhere, int pageIndex, int pageSize, out int pageCount)
        {
            return RestaurantDAL.Search(sqlWhere,pageIndex,pageSize,out pageCount);
        }

        #endregion

        #region DishesCat

        /// <summary>
        /// Insert Or Update
        /// </summary>
        public static bool Save(DishesCatModel obj)
        {
            return DishesCatDAL.Save(obj);
        }

        public static DishesCatModel GetDishesCatById(int catID)
        {
            return DishesCatDAL.GetDishesCatById(catID);
        }

        public static List<DishesCatModel> GetDishesCatByRestaurantId(int restaurantId)
        {
            return DishesCatDAL.GetDishesCatByRestaurantId(restaurantId);
        }

        public static bool DeleteDishesCatById(int id)
        {
            return DishesCatDAL.Delete(id);
        }
        #endregion

        #region Dishes

        public static bool Save(DishesModel obj)
        {
            return DishesDAL.Save(obj);
        }

        public static DishesModel GetDishesById(decimal codeId)
        {
            return DishesDAL.GetDishesById(codeId);
        }

        /// <summary>
        /// 搜索菜品
        /// </summary>
        public static List<DishesModel> SearchDishes(string sqlWhere, int pageIndex, int pageSize, out int pageCount)
        {
            return DishesDAL.Search(sqlWhere, pageIndex, pageSize, out pageCount);
        }

        /// <summary>
        /// 删除菜品
        /// </summary>
        public static bool DeleteDishesById(decimal codeId)
        {
            return DishesDAL.Delete(codeId);
        }

        #endregion
    }
}
